<?php include("includes/connect_db.php"); ?>
<?php include("includes/core.php"); ?>
<?php
    // echo $_SERVER["SCRIPT_NAME"];
    
?>

<!DOCTYPE html>
<html>
    <head>
        <title>Puri Nusa Digital Office</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!-- Bootstrap -->
        <link href="css/bootstrap.css" rel="stylesheet" media="screen">
        <link type="text/css" href="css/validationEngine.jquery.css" rel="stylesheet">
        <link type="text/css" href="css/DT_bootstrap.css" rel="stylesheet">
        <!-- <link type="text/css" href="css/jquery-ui-1.10.0.custom.css" rel="stylesheet" /> -->
        <link type="text/css" href="css/bootstrap-modal.css" rel="stylesheet">
        <link type="text/css" href="css/bootstrap-switch.css" rel="stylesheet">
        <link type="text/css" href="css/bootstrap-datepicker.css" rel="stylesheet">
        <link type="text/css" href="css/bootstrap-timepicker.css" rel="stylesheet">
        <link type="text/css" href="css/font-awesome.css" rel="stylesheet">
        <link href='css/fullcalendar.css' rel='stylesheet' />
        <link href='css/chart/morris.css' rel='stylesheet' />
        <link href="css/theme.css" rel="stylesheet" media="screen">
        <link href="css/select2.css" rel="stylesheet" media="screen">
        <link href="css/select2-bootstrap.css" rel="stylesheet" media="screen">
        <link href="css/bootstrap-spinedit.css" rel="stylesheet" media="screen">
        <link href="css/style.css" rel="stylesheet" media="screen">
        <link rel="shortcut icon" href="img/favico.ico" type="image/x-icon" >

        <script src="js/jquery.js"></script>
    </head>
    <body>
        <?php 
            if (isset($_SESSION["idUser"])) { 
        ?>
        <div id="header" class="navbar navbar-inverse navbar-fixed-top">
            <div id="header-content">
                <a href="/">
                  <div id="header-logo">
                    <div style="height:100%">
                      <img src="../img/logo-pn.png" style="height:inherit; padding-top:0px;">
                    </div>
                  </div>
                </a>
                <div id="header-info">
                    <div class="display-table">
                        <div>
                            <ul class="nav pull-right">
                                <li class="dropdown">
                                    <span class="dropdown-toggle" data-toggle="dropdown">
                                        <i class="fa fa-white fa-user"></i>
                                        <?php
                                            $sql = "SELECT tipe_user.* FROM user 
                                                    INNER JOIN tipe_user
                                                        ON tipe_user.id = user.idtipe_user
                                                    WHERE user.id = '$_SESSION[idUser]'";

                                            $query = mysql_query($sql);
                                            $result = mysql_fetch_array($query);

                                            echo $result["nama"];
                                        ?>
                                    </span>
                                    <ul class="dropdown-menu">
                                        <li>
                                            <?php $param = trim(base64_encode("id"), '=')."=".base64_encode($_SESSION[idUser]) ?>
                                            <a href="/user-edit.php?<?php echo $param ?>">
                                                Account Settings
                                            </a>
                                        </li>
                                        <li class="divider"></li>
                                        <!-- <li>
                                            <a href="#">
                                                Dropdown Menu 1
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                Dropdown Menu 2
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                Dropdown Menu 3
                                            </a>
                                        </li>
                                        <li class="divider"></li> -->
                                        <li class="logout-button">
                                            <a href="#">
                                                <i class="fa fa-off"></i>
                                                Log Out
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>

        <div id="modal-placer"></div>

        <div id="body">
            <div id="content">
                <div id="wrapper">

        <?php 
            } 
        ?>